<!--
  Generated template for the ConsumerorderPage page.

  See http://ionicframework.com/docs/components/#navigation for more info on
  Ionic pages and navigation.
-->
<ion-header class="bg-header">
  <ion-navbar>
    <ion-buttons start>
      <button ion-button (click)="gotop()">
        <img src="assets/img/back.png" width='15' height='20'>
      </button>
    </ion-buttons>
    <ion-title>消息</ion-title>
  </ion-navbar>
</ion-header>


<ion-content padding>
  <div class="box" *ngFor="let item of items">
    <div>
      <img class="photo" [src]='picture+item.message.message_avator' alt="">
      <div class="msg">
        <img src="assets/img/xiaosanjiao@2x.png" alt="">
        <div>

          <!-- 拒绝/同意 邀请/申请 -->
          <div class="join" *ngIf="item.type_result != 0">
            <!-- 申请加入店铺 -->
            <div style="color:#333" *ngIf="item.message_type==3">美甲师申请加入店铺</div>
            <div style="color:#333" *ngIf="item.message_type==4">美甲店邀请加入店铺</div>

            <div>
              <!-- 用户头像 -->
              <img class="userPhoto" [src]='picture+item.message_from.user_avator' alt="">
              <!-- 用户名字 -->
              <span style="font-weight: 550">{{item.message_from.user_nickname}}</span>
            </div>

            <!-- 申请 -->
            <div class="space-between top" *ngIf="item.message_type==3">
              <div class="btn" (click)="refuse()">拒绝</div>
              <div class="btn red" (click)="agree()">接受</div>
            </div>
            <!-- 邀请 -->
            <div class="space-between top" *ngIf="item.message_type==4">
              <div class="btn" (click)="refuseUser()">拒绝</div>
              <div class="btn red" (click)="agreeUser()">接受</div>
            </div>


            <!-- 接受邀请 -->
            <div class="top" *ngIf="item.type_result==2">
              <img class="right-img" src="assets/img/shenqingchenggong@2x.png" alt="">
              <span style="color:#FF5D5D">同意了</span>
            </div>



            <!-- 拒绝邀请 -->
            <div class="top" *ngIf="item.type_result== 3">
              <img class="right-img" src="assets/img/jujue@2x.png" alt="">
              <span style="color:#FF5D5D">拒绝了</span>
            </div>

          </div>


          <!-- 回复内容  -->
          <div class="text" *ngIf="item.type_result== 0">
            {{item.message_content}}
          </div>



        </div>
      </div>
    </div>
    <div class="time">{{item.add_time}}</div>
  </div>

  <ion-infinite-scroll (ionInfinite)="$event.waitFor(doInfinite())">
    <ion-infinite-scroll-content></ion-infinite-scroll-content>
  </ion-infinite-scroll>

</ion-content>